package com.kantboot.business.talent.domain.entity;


import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Entity
@Getter
@Setter
@Table(name = "bus_talent_title_level_condition")
@Accessors(chain = true)
@EntityListeners(AuditingEntityListener.class)
@DynamicUpdate
@DynamicInsert
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class BusTalentTitleLevelCondition implements Serializable {


    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 创建时间
     */
    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @CreatedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;

    /**
     * 绑定的职称等级
     */
    @Column(name = "title_level_id")
    private Long titleLevelId;

    /**
     * 对应系列id
     */
    @Column(name = "series_id")
    private String seriesId;

    /**
     * 等级数值
     * 数值越高，等级越高
     */
    @Column(name = "t_number")
    private Long number;

    /**
     * 描述
     */
    @Column(name = "description",length = 5000)
    private String description;

    /**
     * 从事本系列工作最低年限
     */
    @Column(name = "work_years")
    private Integer workYears;

    /**
     * 所需的学历
     */
    @Column(name = "edu_level_number")
    private Integer eduLevelNumber;

    /**
     * 取得学历后的年满
     */
    @Column(name = "edu_work_years")
    private Integer eduWorkYears;

    /**
     * 是否国外院校
     */
    @Column(name = "is_foreign_school")
    private Boolean isForeignSchool;

    /**
     * 是否需要判断教育专业和系列匹配
     */
    @Column(name = "is_need_check_edu_major_and_series")
    private Boolean isNeedCheckEduMajorAndSeries;

    /**
     * 需要的职称等级ID
     */
    @Column(name = "need_title_level_id")
    private Long needTitleLevelId;

    /**
     * 职称等级需要的年满
     */
    @Column(name = "need_title_level_work_years")
    private Integer needTitleLevelWorkYears;

    /**
     * 非学制不满两年制的国外学历
     * isNotNotTwoYearsEdu
     */
    @Column(name = "is_not_not_two_years_edu_foreign")
    private Boolean isNotNotTwoYearsEduForeign;

    /**
     * 学制不满两年制的国外学历
     * 已废弃，勿动
     */
    @Column(name = "is_not_two_years_edu_foreign")
    private Boolean isNotTwoYearsEduForeign;

    /**
     * 是否多学位
     */
    @Column(name = "is_multi_degree")
    private Boolean isMultiDegree;

    /**
     * 绩效考核满足分数
     */
    @Column(name = "performance_score")
    private BigDecimal performanceScore;

    /**
     * `绩效考核满足分数`年满
     */
    @Column(name = "performance_score_years")
    private Integer performanceScoreYears;

    /**
     * 关联的人才计划
     */
    @OneToMany
    @JoinColumn(name = "title_level_condition_id")
    private List<BusTalentTitleLevelConditionPlan> plans;

    /**
     * 关联的奖项
     */
    @OneToMany
    @JoinColumn(name = "title_level_condition_id")
    private List<BusTalentTitleLevelConditionAward> awards;

    /**
     * 政府津贴等级数值
     * 10000 国务院政府特殊津贴
     * 9000  省部级政府特殊津贴
     */
    @Column(name = "need_government_allowance_level")
    private Integer needGovernmentAllowanceLevel;

}
